当前位置: 首页> 函数类别大全> sqrt

sqrt

平方根
名称:sqrt
分类:数学
所属语言:php
一句话介绍:平方根。

定义和用法

sqrt() 函数返回一个数的平方根。

实例

在本例中,我们将返回不同数的平方根:

<?php
echo(sqrt(0));
echo(sqrt(1));
echo(sqrt(9));
echo(sqrt(0.64));
echo(sqrt(-9));
?>

亲自试一试

语法

sqrt(x)
参数 描述
x 必需。一个数字。

说明

返回 x 的平方根。

同类函数
  •  计算一直角三角形的斜边长度 hypot

    hypot

    计算一直角三角形的斜边长度
  •  反双曲余弦 acosh

    acosh

    反双曲余弦
  •  找出最大值 max

    max

    找出最大值
  •  对浮点数进行四舍五入 round

    round

    对浮点数进行四舍五入
  •  以 10 为底的对数 log10

    log10

    以10为底的对数
  •  返回 log(1 + number),甚至当 number 的值接近零也能计算出准确结果 log1p

    log1p

    返回log(1+number),甚至当n
  •  反正切 atan

    atan

    反正切
  •  八进制转换为十进制 octdec

    octdec

    八进制转换为十进制
热门文章